package cn.zcib.film.mapper;

import cn.zcib.film.bean.Subject;
import cn.zcib.film.bean.vo.SellVO;
import cn.zcib.film.bean.vo.SubjectVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface SubjectMapper {
    //添加电影
    int addSubject(Subject subject);
    //修改电影
    int updateSubjectById(Subject subject);
    //删除电影
    int deleteSubjectById(Integer sId);
    //获得所有电影信息
    List<Subject> getSubjects(SubjectVO vo);

    /**
     * 根据类型编号查询电影信息
     * @param typeId
     */
    @Select("select count(*) from tbl_subject where type_id = #{typeId}")
    int getSubCountByTypeId(Integer typeId);

    int getSubCountByTypeIds(@Param("tIds") List<Integer> tIds);

    //批量删除电影
    int groupDelSubject(@Param("ids") List<Integer> sIds);

    //统计电影数量
    @Select("Select count(*) from tbl_subject")
    int countSubjects();
    //统计销售额
    List<SellVO> getSell();
    //获得前十
    List<Subject> getTopStar();

}
